local skel = fk.CreateSkill {
  name = "efengqi__dulie",
}

Fk:loadTranslationTable{
  ["efengqi__dulie"] = "笃烈",
  [":efengqi__dulie"] = "你成为其他角色的锦囊牌的目标后，你可以与其拼点，赢者摸两张牌，若为你，你本阶段出【杀】次数+1。",

  ["#efengqi__dulie-ask"] = "笃烈：你可以与 %src 拼点，赢者摸两张牌，若你赢，你本阶段出【杀】次数+1。",

  ["$efengqi__dulie1"] = "水背源则川竭，人背信则名裂！",
  ["$efengqi__dulie2"] = "善不由外来，名不可虚作！",
}

skel:addEffect(fk.TargetConfirmed, {
  anim_type = "drawcard",
  can_trigger = function(self, event, target, player, data)
    if player:hasSkill(skel.name) and target == player and data.card.type == Card.TypeTrick then
      local from = data.from
      return from and from ~= player and player:canPindian(from)
    end
  end,
  on_cost = function(self, event, target, player, data)
    if player.room:askToSkillInvoke(player, { skill_name = skel.name, prompt = "#efengqi__dulie-ask:"..data.from.id }) then
      event:setCostData(self, { tos = {data.from} })
      return true
    end
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    local from = data.from
    local pindian = player:pindian({from}, skel.name)
    if pindian and pindian.results[from] then
      local winner = pindian.results[from].winner
      if winner then
        if not winner.dead then
          winner:drawCards(2, skel.name)
        end
        if winner == player then
          room:addPlayerMark(player, MarkEnum.SlashResidue.."-phase")
        end
      end
    end
  end,
})



return skel
